import Vue from 'vue';
import VueRouter from 'vue-router';

Vue.use(VueRouter);

const router = new VueRouter({
    mode: 'hash',
    routes: [
        {
            path: '/',
            name: 'home',
            redirect: '/main',
            component: () => import('@/views/Index'),
            children: [
                {
                    path: 'view',
                    name: 'view',
                    component: () => import('@/views/View')
                },
                {
                    path: 'main',
                    name: 'main',
                    component: () => import ('@/views/Main')
                },
            ]
        },
        {
            path: '/detail/:id',
            name: "detail",
            component: () => import('@/views/Detail')
        },
        {
            path: '/pic',
            name: "pic",
            component: () => import('@/views/PicShow')
        }
    ]
})


export default router;